<template>
    <div class="clock-wrap">
        <i class="scale-item" v-for="(item, index) in scale" :key="index" :style="rotate(index)"></i>
        <div>
            <span>11</span>
            <span>1</span>
        </div>
        <div>
            <span>10</span>
            <span>2</span>
        </div>
        <div>
            <span>9</span>
            <span>3</span>
        </div>
        <div>
            <span>8</span>
            <span>4</span>
        </div>
        <div>
            <span>7</span>
            <span>5</span>
        </div>
        <div>
            <span>12</span>
            <span>6</span>
        </div>
    </div>
</template>
<script setup>
import { ref } from "vue"
const scale = ref([])
for(let i = 0; i < 31; i++) {
    scale.value.push(null)
}
const rotate = (index) => {
    return {'transform': `rotate(${index * 6}deg)`}
}
</script>
<style lang="scss" scoped>
.clock-wrap {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 100%;
    height: 100%;
    z-index: -1;
    border-radius: 100%;
    border: 2px solid #000;
    box-sizing: border-box;
    > div {
        position: absolute;
        box-sizing: border-box;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.8rem;
        span {
            line-height: 1;
        }
    }
    > div:nth-of-type(1) {
        top: 1rem;
        padding: 0 2.5rem;
    }
    > div:nth-of-type(2) {
        top: 2rem;
        padding: 0 1.4rem;
    }
    > div:nth-of-type(3) {
        top: 3.6rem;
        padding-left: 1rem;
        padding-right: 0.7rem;
    }
    > div:nth-of-type(4) {
        top: 5.3rem;
        padding-left: 1.5rem;
        padding-right: 1.3rem;
    }
    > div:nth-of-type(5) {
        top: 6.3rem;
        padding-left: 2.7rem;
        padding-right: 2.5rem;
    }
    > div:nth-of-type(6) {
        flex-wrap: wrap;
        left: 50%;
        bottom: 0;
        top: 0;
        right: auto;
        width: auto;
        flex-direction: column;
        transform: translateX(-50%);
        bottom: 0;
        padding-top: 0.5rem;
        padding-bottom: 1.2rem;
        height: 100%;
    }
    .scale-item {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        height: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 1px;
        border-top: 4px solid #000;
        border-bottom: 4px solid #000;
        box-sizing: border-box;
    }
    .scale-item:nth-child(6),
    .scale-item:nth-child(11),
    .scale-item:nth-child(16),
    .scale-item:nth-child(21),
    .scale-item:nth-child(26),
    .scale-item:nth-child(31) {
        width: 2px;
        border-top: 8px solid #000;
        border-bottom: 8px solid #000;
    }
}
</style>